<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form" >
            <el-descriptions  title="基本信息" style="text-align: center" :column="2" border >
              <el-descriptions-item label="企业名称"  label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.enterpriseName}}</el-descriptions-item>
              <el-descriptions-item label="统一社会信用代码"   label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.enterpriseNumber}}</el-descriptions-item>
              <el-descriptions-item label="注册人姓名"  label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.registrationName}}</el-descriptions-item>
              <el-descriptions-item label="注册人身份证号"  label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.registrationNumber}}</el-descriptions-item>
              <el-descriptions-item label="手机号码"  label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.phone}}</el-descriptions-item>
              <el-descriptions-item label="邮箱"  label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.email}}</el-descriptions-item>
              <el-descriptions-item label="注册时间"  label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.registrationTime}}</el-descriptions-item>
            </el-descriptions>
            <br/>
            <el-descriptions  title="企业主要信息" :column="2" border >
              <el-descriptions-item label="法人姓名" label-class-name="my-label"   :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.corporateName}}</el-descriptions-item>
              <el-descriptions-item label="法人邮箱" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.corporateEmail}}</el-descriptions-item>
              <el-descriptions-item label="法人电话" label-class-name="my-label"   :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.corporatePhone}}</el-descriptions-item>
              <el-descriptions-item label="法人身份证号" label-class-name="my-label"   :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.corporateNumber}}</el-descriptions-item>
              <el-descriptions-item label="企业营业执照" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle"><el-button type="text" size="medium" @click="downloadEvt">查看照片</el-button></el-descriptions-item>
              <el-descriptions-item label="营业执照注册地" label-class-name="my-label"   :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.licenseAddress}}</el-descriptions-item>
              <el-descriptions-item label="企业地址" label-class-name="my-label"   :contentStyle='contentStyle' :labelStyle="labelStyle">{{ form.enterpriseAddress}}</el-descriptions-item>
            </el-descriptions>
             <br/>
      </el-form>
      <br/>
      <div style="float:right; margin-bottom: 15px;">
        <el-button @click="viewCancel">返 回</el-button>
      </div>
    </el-card>
  </div>
</template>
<script>
  import { listBaseinfo, getBaseinfo, delBaseinfo, addBaseinfo, updateBaseinfo,aduitBaseinfo,enterlistBaseinfo } from "@/api/module/cjl/baseinfo";

export default {
  name: "baseinfo",
  data() {
    return {
      contentStyle: {
        'width': '400px',
      },
      //label样式
      labelStyle: { 'width': '140px','color': '#000000','text-align': 'right', },
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: false,
      // 总条数
      total: 0,
      // 部门树选项
      deptOptions: undefined,
      // 合同台账表格数据
      contractList: [],
      // 岗位选项
      postOptions: [],
      // 部门名称
      deptName: undefined,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
      // 用户查询参数
      view:{
        // 是否显示弹出层（用户查询）
        open: false,
        // 弹出层标题（用户查询）
        title: "",
      },
    };
  },
  created() {
    const id = this.$route.query.id;
    if (id) {
      // 获取表详细信息
      getBaseinfo(id).then(res => {
        this.form = res.data;
      });
    }
  },
  methods: {
    downloadEvt(url, fileName = '企业营业执照') {
      const el = document.createElement('a');
      el.style.display = 'none';
      el.setAttribute('target', '_blank');
      fileName && el.setAttribute('download', fileName);
      url= this.form.businessLicense
      el.href = url;
      console.log(el);
      document.body.appendChild(el);
      el.click();
      document.body.removeChild(el);
    },
    /** 关闭按钮 */
    viewCancel() {
      const id = this.$route.query.id;
      getBaseinfo(id).then(response => {
        this.form = response.data;

      });
      const obj = { path: "/qiye", query: {id} };
      this.$tab.closeOpenPage(obj);
  },
  }
};
</script>
<style lang="scss" scoped>



</style>
